package com.xc.hotelmgr.webapi.modules.op.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xc.hotelmgr.webapi.common.utils.PageUtils;
import com.xc.hotelmgr.webapi.common.utils.Query;

import com.xc.hotelmgr.webapi.modules.op.dao.OurRateplanDao;
import com.xc.hotelmgr.webapi.modules.op.entity.OurRateplanEntity;
import com.xc.hotelmgr.webapi.modules.op.service.OurRateplanService;


@Service("ourRateplanService")
public class OurRateplanServiceImpl extends ServiceImpl<OurRateplanDao, OurRateplanEntity> implements OurRateplanService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String dtId = (String) params.get("dtId");
        String groupId = (String) params.get("groupId");
        IPage<OurRateplanEntity> page = new Query<OurRateplanEntity>().getPage(params);
        List<OurRateplanEntity> list = baseMapper.sqlQuryPage(page,dtId,groupId);
        PageUtils pageUtils = new PageUtils(page, list);
        return pageUtils;
    }

    @Override
    public OurRateplanEntity sqlQuryById(Long id) {
        return baseMapper.sqlQuryById(id);
    }

    @Override
    public List<Integer> getByGroupId(Integer groupId) {
        return baseMapper.getByGroupId(groupId);
    }
}